#
# ckcore/Makefile
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
# for "archclean" for cleaning up for this architecture
#
# This file is subject to the terms and conditions of the GNU General Public
# License.  See the file "COPYING" in the main directory of this archive
# for more details.
#
# (C) Copyright 2004, Li Chunqiang (chunqiang_li@c-sky.com)
# (C) Copyright 2009, Hu Junshan (junshan_hu@c-sky.com)
# (C) Copyright 2009, C-SKY Microsystems Co., Ltd. (www.c-sky.com)
#

#
# To select default config enrty. If you want to use default config, you can 
#   enter "make defconfig".
#
KBUILD_DEFCONFIG := ckcore_defconfig

UTS_SYSNAME = -DUTS_SYSNAME=\"linux\"

ifdef CONFIG_CPU_HAS_DSP
CPUTYPE = -mcpu=ck610ef
else
CPUTYPE = -mcpu=ck610f
endif

KBUILD_CFLAGS += -fsigned-char  -mbig-endian -g\
                 $(KBUILD_CFLAGS) -I$(INCGCC) \
                -pipe -DNO_FPU -D__ELF__ -DMAGIC_ROM_PTR \
                -DUTS_SYSNAME=\"linux\" -D__linux__ \
                -DNO_TEXT_SECTIONS $(CPUTYPE) 

machine-$(CONFIG_CK6408EVB) := ck6408evb
machine-$(CONFIG_GX6002) := gx6002 

machdirs := $(patsubst %,arch/ckcore/%/,$(machine-y))

ifeq ($(KBUILD_SRC),)
KBUILD_CFLAGS += $(patsubst %,-I%include,$(machdirs))
else
KBUILD_CFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
endif

KBUILD_AFLAGS += $(KBUILD_CFLAGS)

LDFLAGS += -EB

head-y := arch/ckcore/kernel/head.o

core-y                      += arch/ckcore/kernel/    arch/ckcore/mm/
core-y                      += $(machdirs)
libs-y                      += arch/ckcore/lib/ 


bootstrap:
	@$(MAKEBOOT) bootstrap

archmrproper:

MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot

archclean:
	#@$(MAKEBOOT) clean


